package com.caption.design.mixture;

import org.springframework.stereotype.Component;

@Component
public class AliPayHandler extends AbstractHandler implements Handler{

    @Override
    public void pay() {
        System.out.println("执行支付业务代码");
    }

    @Override
    public void extend() {
        System.out.println("扩展方法");
        execute();
        System.out.println("调用父类公共方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
          PayFactory.register("AliPay",this);
    }
}
